先看一个有错误的代码: string subKeyName = ”Software\Microsoft\Windows\CurrentVersion\Run\”; //subkey name string valueName = ”App Name”; //name of the more specific key that will hold the value, “” means (Default) try …{ RegistryKey reg = Registry.LocalMachine
代码如下:using System; using System.Drawing; using System.Windows.Forms; using System.Threading; using Microsoft.Win32; namespace 星空个性化助手 { public partial class Form1 : Form { private delegate void LoadTreeView左侧( TreeNode node );//声明委托类型 public Form1()
你可以像导航文件系统那样来访问注册表,PowerShell把文件系统和注册表都当作层次信息系统来处理。注册表中的键对应于文件系统的目录,但是键对应的值和文件系统中的文件不是非常类似。相反的,它们显示在属性栏,被以键的属性来管理。 代码如下:PS C:\> Cd HKCU:PS HKCU:\> dir
Hive: HKEY_CURRENT_USER
Name Property—-